#!/bin/bash
echo "Enter OTP code:"
read otp
export NPM_CONFIG_OTP=$otp
function next2latest {
  V=$(npm info $1 dist-tags.next | xargs)
  npm dist-tags add $1@$V latest
}
next2latest graphile
next2latest pg-sql2
next2latest jest-serializer-graphql-schema
next2latest @graphile/lru
next2latest graphql-parse-resolve-info
next2latest graphile-build
next2latest graphile-build-pg
next2latest postgraphile-core
next2latest graphile-utils
next2latest @graphile/pg-pubsub
next2latest @graphile/lds
next2latest @graphile/subscriptions-lds
next2latest postgraphile

echo "DON'T FORGET - you need to push the latest tag to the v4 branch on PostGraphile for Docker to build"
